home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / os20 / cli / FrontPubScreen.lha / FrontPubScreen / FrontPubScreen.c next >
Encoding:
C/C++ Source or Header  |  1992-04-13  |  2.3 KB  |  143 lines

  1. /*4:*/
  2. #line 59 "FrontPubScreen.w"
  3.  
  4. char version[]= "\0$VER: FrontPubScreen 1.0 (4.12.92)";
  5.  
  6. /*:4*//*5:*/
  7. #line 69 "FrontPubScreen.w"
  8.  
  9. /*6:*/
  10. #line 93 "FrontPubScreen.w"
  11.  
  12. #include <exec/types.h>
  13. #include <intuition/intuition.h>
  14. #include <intuition/intuitionbase.h>
  15. #include <dos/dos.h>
  16.  
  17. /*:6*/
  18. #line 70 "FrontPubScreen.w"
  19.  
  20.  
  21. /*7:*/
  22. #line 104 "FrontPubScreen.w"
  23.  
  24.  
  25. #include <proto/intuition.h>
  26. #include <proto/dos.h>
  27. #include <proto/exec.h>
  28.  
  29.  
  30. /*:7*/
  31. #line 72 "FrontPubScreen.w"
  32.  
  33.  
  34. /*8:*/
  35. #line 119 "FrontPubScreen.w"
  36.  
  37.  
  38. struct IntuitionBase*IntuitionBase;
  39. char public_screen_name[MAXPUBSCREENNAME];
  40. struct Screen*public_screen_address;
  41.  
  42. /*:8*//*12:*/
  43. #line 174 "FrontPubScreen.w"
  44.  
  45.  
  46. ULONG intuition_lock;
  47. struct Screen*front_screen_address;
  48. struct List*public_screen_list;
  49. struct PubScreenNode*public_screen_node;
  50.  
  51. /*:12*/
  52. #line 74 "FrontPubScreen.w"
  53.  
  54.  
  55. main(argc,argv)
  56. int argc;
  57. char*argv[];
  58. {
  59. if(argc){
  60. /*9:*/
  61. #line 134 "FrontPubScreen.w"
  62.  
  63.  
  64. IntuitionBase= (struct IntuitionBase*)OpenLibrary("intuition.library",36L);
  65. if(!IntuitionBase){
  66. exit(20L);
  67. }
  68.  
  69. /*:9*/
  70. #line 81 "FrontPubScreen.w"
  71. ;
  72. /*13:*/
  73. #line 197 "FrontPubScreen.w"
  74.  
  75.  
  76. public_screen_name[0]= '\0';
  77.  
  78. intuition_lock= LockIBase(0L);
  79. front_screen_address= IntuitionBase->FirstScreen;
  80. if((front_screen_address->Flags&PUBLICSCREEN)||(front_screen_address->Flags&WBENCHSCREEN)){
  81. UnlockIBase(intuition_lock);
  82. /*14:*/
  83. #line 224 "FrontPubScreen.w"
  84.  
  85.  
  86. public_screen_list= LockPubScreenList();
  87. public_screen_node= (struct PubScreenNode*)public_screen_list->lh_Head;
  88. while(public_screen_node){
  89. if(public_screen_node->psn_Screen==front_screen_address){
  90. strcpy(public_screen_name,public_screen_node->psn_Node.ln_Name);
  91. break;
  92. }
  93. public_screen_node= (struct PubScreenNode*)public_screen_node->psn_Node.ln_Succ;
  94. }
  95. UnlockPubScreenList();
  96.  
  97. /*:14*/
  98. #line 205 "FrontPubScreen.w"
  99. ;
  100. }
  101. else{
  102. UnlockIBase(intuition_lock);
  103. }
  104.  
  105. if(public_screen_name[0]=='\0'){
  106. GetDefaultPubScreen(public_screen_name);
  107. }
  108.  
  109.  
  110. /*:13*/
  111. #line 82 "FrontPubScreen.w"
  112. ;
  113. /*11:*/
  114. #line 158 "FrontPubScreen.w"
  115.  
  116.  
  117. public_screen_address= LockPubScreen(public_screen_name);
  118. if(public_screen_address){
  119. (void)PutStr(public_screen_name);
  120. (void)PutStr("\n");
  121. UnlockPubScreen(NULL,public_screen_address);
  122. }
  123. else{
  124. (void)PutStr("Workbench\n");
  125. }
  126.  
  127. /*:11*/
  128. #line 83 "FrontPubScreen.w"
  129. ;
  130. /*10:*/
  131. #line 146 "FrontPubScreen.w"
  132.  
  133.  
  134. CloseLibrary((struct Library*)IntuitionBase);
  135.  
  136. /*:10*/
  137. #line 84 "FrontPubScreen.w"
  138.  
  139. }
  140. }
  141.  
  142. /*:5*/
  143.